import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  JdSaleOutWarehouseOrder2VO,
  JdSaleOutWarehouseOrder2Form,
  JdSaleOutWarehouseOrder2Query
} from '@/api/jdAndJstSceneClassification/shanmuConsignmentSale/jdSaleOutWarehouseOrder2/types';

/**
 * 查询金蝶-销售出库单列表
 * @param query
 * @returns {*}
 */

export const listJdSaleOutWarehouseOrder2 = (query?: JdSaleOutWarehouseOrder2Query): AxiosPromise<JdSaleOutWarehouseOrder2VO[]> => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询金蝶-销售出库单详细
 * @param id
 */
export const getJdSaleOutWarehouseOrder2 = (id: string | number): AxiosPromise<JdSaleOutWarehouseOrder2VO> => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增金蝶-销售出库单
 * @param data
 */
export const addJdSaleOutWarehouseOrder2 = (data: JdSaleOutWarehouseOrder2Form) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改金蝶-销售出库单
 * @param data
 */
export const updateJdSaleOutWarehouseOrder2 = (data: JdSaleOutWarehouseOrder2Form) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除金蝶-销售出库单
 * @param id
 */
export const delJdSaleOutWarehouseOrder2 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jd/saleOutWarehouseOrder/' + id,
    method: 'delete'
  });
};
